Skip to content

Conversation

Jack251970
Copy link
Member

@Jack251970 Jack251970 commented Jul 20, 2025

CHANGES

TEST

  • Internalization works correctly when application starts

@coderabbitai coderabbitai bot added the enhancement New feature or request label Jul 20, 2025
Copy link

gitstream-cm bot commented Jul 20, 2025

🥷 Code experts: no user but you matched threshold 10

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Core/Plugin/PluginManager.cs

Activity based on git-commit:

Jack251970
JUL 94 additions & 53 deletions
JUN 74 additions & 273 deletions
MAY 298 additions & 25 deletions
APR 73 additions & 68 deletions
MAR 42 additions & 37 deletions
FEB 276 additions & 198 deletions

Knowledge based on git-blame:
Jack251970: 41%

Flow.Launcher.Core/Resource/Internationalization.cs

Activity based on git-commit:

Jack251970
JUL 4 additions & 3 deletions
JUN
MAY 31 additions & 13 deletions
APR 34 additions & 30 deletions
MAR 67 additions & 40 deletions
FEB 5 additions & 4 deletions

Knowledge based on git-blame:
Jack251970: 45%

Flow.Launcher/App.xaml.cs

Activity based on git-commit:

Jack251970
JUL 43 additions & 8 deletions
JUN 6 additions & 0 deletions
MAY 51 additions & 28 deletions
APR 73 additions & 40 deletions
MAR 168 additions & 94 deletions
FEB 79 additions & 40 deletions

Knowledge based on git-blame:
Jack251970: 72%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@Jack251970 Jack251970 added this to the 2.0.0 milestone Jul 20, 2025
Copy link

gitstream-cm bot commented Jul 20, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Contributor

coderabbitai bot commented Jul 20, 2025

📝 Walkthrough

"""

Walkthrough

The changes refactor language initialization and plugin language directory discovery. The PluginManager.Directories field is made public for external access. The Internationalization class is restructured to validate and load language resources more robustly, with explicit control over plugin metadata translation updates. The application startup sequence is adjusted to initialize language resources earlier.

Changes

File(s) Change Summary
Flow.Launcher.Core/Plugin/PluginManager.cs Changed Directories field from private to public, allowing external access to plugin directories.
Flow.Launcher.Core/Resource/Internationalization.cs Refactored language directory discovery and initialization; added validation, new helper methods, and made some methods public/static.
Flow.Launcher/App.xaml.cs Moved language initialization earlier in startup; separated plugin metadata translation update from language initialization.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant Internationalization
    participant PluginManager

    App->>Internationalization: InitializeLanguageAsync()
    Internationalization->>Internationalization: AddFlowLauncherLanguageDirectory()
    Internationalization->>PluginManager: Access Directories (public)
    Internationalization->>Internationalization: AddPluginLanguageDirectories()
    Internationalization->>Internationalization: LoadDefaultLanguage()
    App->>PluginManager: Initialize Plugins
    App->>Internationalization: UpdatePluginMetadataTranslations()
Loading

Possibly related PRs

  • Flow-Launcher/Flow.Launcher#3376: The main PR’s change to make PluginManager.Directories public directly supports the Internationalization class’s updated approach to enumerating plugin language directories from PluginManager.Directories, which is a core part of the language initialization and plugin metadata translation updates introduced in the retrieved PR.
  • Flow-Launcher/Flow.Launcher#2769: The main PR changes the accessibility of PluginManager.Directories to public to enable external access, which directly supports the retrieved PR’s approach of using plugin directories for internationalization and language resource loading in Internationalization.cs; thus, both PRs modify how plugin directories are accessed and used for language management.
  • Flow-Launcher/Flow.Launcher#3365: Related to plugin loading order and interaction with plugin data during startup, which connects to the changes exposing PluginManager.Directories publicly for plugin management internals.

Suggested reviewers

  • jjw24
  • taooceros
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fea899d and 545d12c.

📒 Files selected for processing (2)
  • Flow.Launcher.Core/Plugin/PluginManager.cs (1 hunks)
  • Flow.Launcher/App.xaml.cs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Flow.Launcher.Core/Plugin/PluginManager.cs
  • Flow.Launcher/App.xaml.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
Flow.Launcher.Core/Resource/Internationalization.cs (1)

177-190: Remove unused variable.

The lowercase variable is created but never used after changing to StringComparison.CurrentCultureIgnoreCase.

 private static Language GetLanguageByLanguageCode(string languageCode)
 {
-    var lowercase = languageCode.ToLower();
-    var language = AvailableLanguages.GetAvailableLanguages().FirstOrDefault(o => o.LanguageCode.Equals(lowercase, StringComparison.CurrentCultureIgnoreCase));
+    var language = AvailableLanguages.GetAvailableLanguages().FirstOrDefault(o => o.LanguageCode.Equals(languageCode, StringComparison.CurrentCultureIgnoreCase));
     if (language == null)
     {
         API.LogError(ClassName, $"Language code can't be found <{languageCode}>");
         return AvailableLanguages.English;
     }
     else
     {
         return language;
     }
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff2d5e8 and 2ee53df.

📒 Files selected for processing (3)
  • Flow.Launcher.Core/Plugin/PluginManager.cs (1 hunks)
  • Flow.Launcher.Core/Resource/Internationalization.cs (6 hunks)
  • Flow.Launcher/App.xaml.cs (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Flow.Launcher.Core/Plugin/PluginManager.cs (3)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Flow.Launcher/App.xaml.cs (8)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3672
File: Flow.Launcher/MainWindow.xaml.cs:318-318
Timestamp: 2025-06-08T14:12:12.842Z
Learning: In Flow.Launcher, the App.NotifyIcon static property is initialized in the App class before MainWindow creation, so null checks are not needed when accessing App.NotifyIcon in MainWindow lifecycle methods.
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.
Learnt from: onesounds
PR: Flow-Launcher/Flow.Launcher#0
File: :0-0
Timestamp: 2025-04-23T15:14:49.986Z
Learning: In WPF applications like Flow.Launcher, font styling should be applied using implicit styles instead of setting the FontFamily property on individual controls. Define implicit styles in a ResourceDictionary using <Style TargetType="{x:Type Button}"> format and merge it into App.xaml, which automatically applies the font to all instances of the control type while still allowing explicit overrides where needed.
Learnt from: jjw24
PR: Flow-Launcher/Flow.Launcher#2448
File: Plugins/Flow.Launcher.Plugin.Sys/ThemeSelector.cs:16-20
Timestamp: 2025-01-18T10:10:18.414Z
Learning: In Flow Launcher's plugin system, the PluginInitContext parameter passed to plugin constructors is guaranteed to be non-null by the plugin initialization system, making null checks unnecessary.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Flow.Launcher.Core/Resource/Internationalization.cs (4)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
🔇 Additional comments (8)
Flow.Launcher.Core/Plugin/PluginManager.cs (1)

46-46: LGTM!

Making Directories public is appropriate since it's a readonly field containing only constant values. This change safely enables external code to access plugin directories without risk of modification.

Flow.Launcher/App.xaml.cs (2)

194-196: Good architectural improvement!

Moving language initialization before portable cleanup ensures translations are available when needed, as stated in the PR objectives.


222-223: Logical separation of concerns.

Updating plugin metadata translations after plugin initialization is the correct approach, as plugins need their API instances before translations can be applied.

Flow.Launcher.Core/Resource/Internationalization.cs (5)

82-93: Well-structured initialization flow.

The refactoring improves code organization by extracting directory setup and default language loading into separate methods. Passing false for updateMetadata is correct since plugins aren't initialized at this stage.


115-140: Robust plugin language directory discovery.

The implementation correctly validates each plugin's language directory and handles missing directories/files gracefully with appropriate error logging.


142-149: Clean state management for default language.

The method ensures proper cleanup of old language resources before loading English, preventing language overlap issues.


307-307: Appropriate visibility change.

Making this method public static enables the refactored initialization flow where it's called from App.xaml.cs after plugin initialization.


192-192: Good minor improvements.

  • The optional updateMetadata parameter provides proper control over when plugin metadata translations should be updated.
  • The formatting fix in the Chinese prompt string improves consistency.

Also applies to: 243-243

Copilot

This comment was marked as outdated.

@Jack251970 Jack251970 requested a review from Copilot July 20, 2025 09:27
Copilot

This comment was marked as outdated.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Flow.Launcher.Core/Resource/Internationalization.cs (1)

165-165: Good improvement to use OrdinalIgnoreCase comparison.

The change from CurrentCultureIgnoreCase to OrdinalIgnoreCase provides more predictable behavior for language code comparisons. However, consider renaming the lowercase variable to something like targetLanguageCode since the comparison is now case-insensitive and the ToLower() call is no longer necessary.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e8acf7 and ac7da2d.

📒 Files selected for processing (1)
  • Flow.Launcher.Core/Resource/Internationalization.cs (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3850
File: Flow.Launcher.Core/Resource/Internationalization.cs:0-0
Timestamp: 2025-07-20T07:28:28.055Z
Learning: In Flow Launcher's Internationalization class, when the Flow Launcher language directory or default language file is missing, the only viable approach is to log an error and return early - there are no fallback mechanisms or alternative recovery strategies available due to architectural constraints.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Flow.Launcher.Core/Resource/Internationalization.cs (8)
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3850
File: Flow.Launcher.Core/Resource/Internationalization.cs:0-0
Timestamp: 2025-07-20T07:28:28.055Z
Learning: In Flow Launcher's Internationalization class, when the Flow Launcher language directory or default language file is missing, the only viable approach is to log an error and return early - there are no fallback mechanisms or alternative recovery strategies available due to architectural constraints.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3791
File: Flow.Launcher.Core/Plugin/PluginManager.cs:293-295
Timestamp: 2025-07-01T05:46:13.251Z
Learning: In Flow.Launcher.Core/Plugin/PluginManager.cs, when checking if a plugin is modified within the PluginManager class itself, prefer using the internal static PluginModified(string id) method directly rather than going through API.PluginModified() for better performance and architectural design.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/App.xaml.cs:214-216
Timestamp: 2025-07-06T12:21:37.947Z
Learning: In Flow Launcher, the UpdatePluginManifestAsync method in PluginsManifest.cs already has comprehensive internal try-catch handling that logs exceptions and returns false on failure rather than throwing, making external try-catch wrappers unnecessary.
Learnt from: taooceros
PR: Flow-Launcher/Flow.Launcher#2616
File: Flow.Launcher/Flow.Launcher.csproj:7-7
Timestamp: 2024-10-08T15:52:58.573Z
Learning: In the Flow Launcher project, the version number in the `Flow.Launcher.csproj` file is dynamically updated during the CI/CD process.
Learnt from: Yusyuriv
PR: Flow-Launcher/Flow.Launcher#3057
File: Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs:0-0
Timestamp: 2024-11-03T07:40:11.014Z
Learning: In Flow Launcher, when using Windows Forms dialogs (e.g., in `JsonRPCPluginSettings.cs`), path validation is enabled by default in `OpenFileDialog` and `FolderBrowserDialog`, preventing users from selecting invalid paths, but it's possible to opt out of this validation on individual dialogs.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3561
File: Flow.Launcher/ViewModel/SelectBrowserViewModel.cs:53-58
Timestamp: 2025-05-21T10:37:07.696Z
Learning: When implementing collection item removal operations in Flow Launcher, always handle index boundaries carefully. After removing an item from a collection, ensure the updated index remains within valid bounds (>= 0 and < collection.Count) to prevent IndexOutOfRangeExceptions, especially when decrementing indexes.
Learnt from: Jack251970
PR: Flow-Launcher/Flow.Launcher#3572
File: Flow.Launcher/Helper/PluginInstallationHelper.cs:251-252
Timestamp: 2025-06-29T08:31:07.816Z
Learning: In Flow Launcher's PluginInstallationHelper, when the progress box encounters an exception during download (indicated by reportProgress becoming null), the retry logic intentionally downloads without a progress handler to avoid repeating the same progress reporting failure. This prevents cascading exceptions in the progress reporting mechanism.
Learnt from: jjw24
PR: Flow-Launcher/Flow.Launcher#3081
File: Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs:136-145
Timestamp: 2025-02-22T23:51:54.010Z
Learning: In Flow.Launcher JsonRPCV2 plugins, the `reload_data` method is optional for plugins to implement. When the method is not found (RemoteMethodNotFoundException), it should be silently caught without logging as this is an expected scenario.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: gitStream.cm
  • GitHub Check: build
🔇 Additional comments (7)
Flow.Launcher.Core/Resource/Internationalization.cs (7)

95-106: LGTM! Proper validation and error handling implementation.

The method correctly validates the Flow Launcher language directory existence and handles the missing directory case appropriately by logging an error and returning early, which aligns with Flow Launcher's architectural constraints.


108-125: LGTM! Robust plugin language directory discovery.

The method properly handles optional plugin directories by silently skipping non-existent paths and only adding valid language directories. The defensive programming approach with existence checks at each level is appropriate.


127-134: LGTM! Good separation of concerns.

Extracting the default language loading logic into a separate method improves code organization and makes the initialization process more explicit and readable.


177-177: LGTM! Excellent separation of concerns.

The optional updateMetadata parameter provides better control over the language change process, allowing initialization to skip metadata updates while maintaining backward compatibility. The async handling of metadata updates is appropriate.

Also applies to: 189-194


292-292: Method signature change enables independent metadata updates.

The change to a public static method allows external components to update plugin metadata translations independently, supporting the separation of language initialization from metadata updates.


228-228: LGTM! Minor formatting fix for string consistency.


82-93: LGTM! Improved initialization sequence control.

The explicit calls to directory setup and default language loading, combined with skipping metadata updates during initialization (updateMetadata = false), provide better control over the language initialization process and align with the PR objectives.

@Jack251970 Jack251970 requested a review from Copilot July 20, 2025 09:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reorganizes the language initialization process in Flow Launcher to ensure translations are available before portable cleanup and plugin initialization. This addresses issues where components requiring translations weren't properly initialized.

  • Move language initialization earlier in the startup sequence
  • Refactor internationalization code to support early initialization without plugin dependencies
  • Separate plugin metadata translation updates from initial language setup

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
Flow.Launcher/App.xaml.cs Moves language initialization before portable cleanup and separates metadata updates
Flow.Launcher.Core/Resource/Internationalization.cs Major refactoring with improved organization, early initialization support, and method visibility changes
Flow.Launcher.Core/Plugin/PluginManager.cs Exposes Directories property as public for internationalization access

@Jack251970 Jack251970 changed the title Initialize language before portable clean up Initialize language before portable clean up and plugin initialization Jul 20, 2025
@jjw24 jjw24 merged commit c02ef0e into dev Jul 21, 2025
6 checks passed
@jjw24 jjw24 deleted the fast_load_language branch July 21, 2025 02:20
@jjw24 jjw24 changed the title Initialize language before portable clean up and plugin initialization Initialize language earlier for portable clean up and plugin initialization Jul 21, 2025
@jjw24 jjw24 added bug Something isn't working and removed enhancement New feature or request 10 min review labels Jul 21, 2025
TBM13 pushed a commit to TBM13/Flow.Launcher that referenced this pull request Aug 13, 2025
…nguage

Initialize language before portable clean up and plugin initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants